{if condition="$isweixin eq 1 and $sign neq ''"}
 <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
 <script>
 
  wx.config({
      debug     : false,
      appId     : '{$sign["AppId"]}',
      timestamp : {$sign["TimeStamp"]},
      nonceStr  : '{$sign["NonceStr"]}',
      signature : '{$sign["Signature"]}',
      jsApiList : [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
      ]
  });
  
  var wxpic   = '{$wxpic}';
  var wxdesc  = '{:mb_substr($des,0,50,"utf-8")}';
  var wxtitle = '{$title}';
  var wxurl   = '{$url}';
  wx.ready(function () {
	
  document.querySelector('#checkJsApi').onclick = function () {
    wx.checkJsApi({
      jsApiList: [
        'checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'onMenuShareQZone'
      ],
      success: function (res) {
        alert(JSON.stringify(res));
      }
    });
  };
	//分享给朋友
  
	  wx.onMenuShareAppMessage({
	    title  : wxtitle,
	    desc   : wxdesc,
	    link   : wxurl,
	    imgUrl : wxpic,
	    trigger: function (res) {},
	    success: function (res) {},
	    cancel: function (res) {},
	    fail: function (res) {}
	  });
    
	//分享到朋友圈
      wx.onMenuShareTimeline({
        title   : wxtitle,
        link    : wxurl,
        imgUrl  : wxpic,
        trigger : function (res) {},
        success : function (res) {},
        cancel  : function (res) {},
        fail    : function (res) {}
      });
    
    //分享到QQ
	
	  wx.onMenuShareQQ({
		title    : wxtitle,
		desc     : wxdesc,
		link     : wxurl,
		imgUrl   : wxpic,
		trigger  : function (res) {},
		complete : function (res) {},
		success  : function (res) {},
		cancel   : function (res) {},
		fail     : function (res) {}
	  });
    
	//分享到微博
   
      wx.onMenuShareWeibo({
        title    : wxtitle,
        desc     : wxdesc,
        link     : wxurl,
        imgUrl   : wxpic,
        trigger  : function (res) {},
        complete : function (res) {},
        success  : function (res) {},
        cancel   : function (res) {},
        fail     : function (res) {}
      });
    
	//分享到QZone
    
      wx.onMenuShareQZone({
        title    : wxtitle,
        desc     : wxdesc,
        link     : wxurl,
        imgUrl   : wxpic,
        trigger  : function (res) {},
        complete : function (res) {},
        success  : function (res) {},
        cancel   : function (res) {},
        fail     : function (res) {}
     });
   
  
 });
 wx.error(function (res) {
  alert(res.errMsg);
 });
 </script>
{/if}